import service from '@/utils/request'

export const useOrgListApi = () => {
  return service.get('/sys/org/list')
}

export const useOrgList2Api = () => {
  return service.get('/sys/org/list2')
}
export const useOrgList3Api = (data) => {
  return service.get('/sys/org/list3', {
    params: data
  })
}
export const useGroupListApi = () => {
  return service.get('/gps/group/list')
}

export const useOrgApi = (id: Number) => {
  return service.get('/sys/org/' + id)
}

export const useOrgNameListApi = (idList: number[]) => {
  return service.post('/sys/org/nameList', idList)
}

export const useOrgSubmitApi = (dataForm: any) => {
  if (dataForm.id) {
    return service.put('/sys/org', dataForm)
  } else {
    return service.post('/sys/org', dataForm)
  }
}
